<?php
class CenterNavWidget extends CWidget
{
    public $shipper_type = 0;    
    public $carry_type = 0;
    public function init()
    {
        parent::init();
    }
    public function run()
    {
        $sid = Yii::app()->user->getId();
        $user = User::model()->getBySid($sid);
        $this->shipper_type = User::model()->getShipperTypeBySid(Yii::app()->user->getId());
        $this->carry_type = User::model()->getCarryTypeBySid(Yii::app()->user->getId());
        if($user['errno']==0){
            $avatar = $user['result']['avatar'];

        }else{
            $avatar = '';
        }
        $this->render('center_nav',compact('avatar'));
    }
}
?>
